package com.fzq.configclient.configclient;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.xml.ws.Response;

@RestController
//@RefreshScope
public class TestController {
    //    @Value("${flower.color}")
    private String applicationName;

    @Autowired
    private Flower flower;

    @GetMapping("/config")
    public ResponseEntity test() {
        return ResponseEntity.ok(flower.getColor());
    }
}
